| Fully Qualified Name: | Laminas\View\Renderer\JsonRenderer |
| Implements: | RendererInterface, TreeRendererInterface |
JSON renderer
| Name | Description | Defined By |
|---|---|---|
| canRenderTrees() | Can this renderer render trees of view models? | JsonRenderer |
| getEngine() | Return the template engine object, if any | JsonRenderer |
| hasJsonpCallback() | Returns whether or not the jsonpCallback has been set | JsonRenderer |
| mergeUnnamedChildren() | Should we merge unnamed children? | JsonRenderer |
| render() | Renders values as JSON | JsonRenderer |
| setJsonpCallback() | Set the JSONP callback function name | JsonRenderer |
| setMergeUnnamedChildren() | Set flag indicating whether or not to merge unnamed children | JsonRenderer |
| setResolver() | Set the resolver used to map a template name to a resource the renderer may consume. | JsonRenderer |
Can this renderer render trees of view models?
Yes.
Returns: bool
Return the template engine object, if any
If using a third-party template engine, such as Smarty, patTemplate, phplib, etc, return the template engine object. Useful for calling methods on these objects, such as for setting filters, modifiers, etc.
Returns: mixed
Returns whether or not the jsonpCallback has been set
Returns: bool
Should we merge unnamed children?
Returns: bool
Renders values as JSON
| Parameter Name | Type | Description |
|---|---|---|
| $nameOrModel | string|\Model | The |
| $values | null|array|\ArrayAccess | Values |
Returns: string The script output.
Set the JSONP callback function name
| Parameter Name | Type | Description |
|---|---|---|
| $callback | string |
Returns: \JsonRenderer
Set flag indicating whether or not to merge unnamed children
| Parameter Name | Type | Description |
|---|---|---|
| $mergeUnnamedChildren | bool |
Returns: \JsonRenderer
Set the resolver used to map a template name to a resource the renderer may consume.
| Parameter Name | Type | Description |
|---|---|---|
| $resolver | \Resolver |
Returns: \Renderer